<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .box{
      width: 560px;
      height: 300px;
      margin: 50px auto;
      position: relative;
    }
    .box ul{
      width: 100%;
      height: 100%;
      transform-style: preserve-3d;
    }
    .box li{
      width: 100%;
      height: 100%;
      position: absolute;
    }
    .box li:nth-child(1){
      background-image: url("img/1.jpg");
      background-repeat: no-repeat;
      transform: translateZ(150px)
    }
    .box li:nth-child(2){
      background-image: url("img/2.jpg");
      background-repeat: no-repeat;
      transform: rotateX(90deg) translateZ(150px)
    }
    .box li:nth-child(3){
      background-image:url("img/3.jpg");
      background-repeat: no-repeat;
      transform: rotateX(180deg) translateZ(150px);
    }
    .box li:nth-child(4){
      background-image: url("img/4.jpg");
      background-repeat: no-repeat;
      transform: rotateX(-90deg) translateZ(150px);
    }
    a{
      width: 40px;
      height: 60px;
      display: block;
      text-align: center;
      line-height: 60px;
      color:#fff;
      text-decoration: none;
      background-color: rgba(0,0,0,0.5);
      position: absolute;
      top:50%;
      margin-top:-30px;
      font-family: "宋体";
    }
    a:nth-child(3){
      right:0;
    }
  </style>
</head> 
<body>
  <div class="box">
    <ul>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
    <a href="#"><</a>
    <a href="#">></a>
  </div>
  <script>
    var prev_btn = document.querySelector('a:nth-child(2)');
    var next_btn = document.querySelector('a:nth-child(3)');
    var ul = document.querySelector('ul');
    var index = 0;
    next_btn.onclick = function(){
      index --;
      ul.style.transform = 'rotateX('+index*90+'deg)';
      ul.style.transition = "all 1s linear";
    }
    prev_btn.onclick = function(){
      index ++;
      ul.style.transform = 'rotateX('+index*90+'deg)';
      ul.style.transition = 'all 1s linear';
    }

  </script>
</body>
</html> 